package cn.com.yusys.yusp.message.domain;

import cn.com.yusys.yusp.commons.mapper.domain.BaseDomain;
import java.io.Serializable;
import javax.persistence.*;

@Table(name = "MESSAGE_SUBSCRIBE")
public class MessageSubscribe extends BaseDomain implements Serializable {
    @Id
    @Column(name = "CHANNEL_TYPE")
    private String channelType;

    @Id
    @Column(name = "MESSAGE_TYPE")
    private String messageType;

    @Id
    @Column(name = "SUBSCRIBE_TYPE")
    private String subscribeType;

    @Id
    @Column(name = "SUBSCRIBE_VALUE")
    private String subscribeValue;

    @Column(name = "OP_USER_NO")
    private String opUserNo;

    private static final long serialVersionUID = 1L;

    /**
     * @return CHANNEL_TYPE
     */
    public String getChannelType() {
        return channelType;
    }

    /**
     * @param channelType
     */
    public void setChannelType(String channelType) {
        this.channelType = channelType == null ? null : channelType.trim();
    }

    /**
     * @return MESSAGE_TYPE
     */
    public String getMessageType() {
        return messageType;
    }

    /**
     * @param messageType
     */
    public void setMessageType(String messageType) {
        this.messageType = messageType == null ? null : messageType.trim();
    }

    /**
     * @return SUBSCRIBE_TYPE
     */
    public String getSubscribeType() {
        return subscribeType;
    }

    /**
     * @param subscribeType
     */
    public void setSubscribeType(String subscribeType) {
        this.subscribeType = subscribeType == null ? null : subscribeType.trim();
    }

    /**
     * @return SUBSCRIBE_VALUE
     */
    public String getSubscribeValue() {
        return subscribeValue;
    }

    /**
     * @param subscribeValue
     */
    public void setSubscribeValue(String subscribeValue) {
        this.subscribeValue = subscribeValue == null ? null : subscribeValue.trim();
    }

    /**
     * @return OP_USER_NO
     */
    public String getOpUserNo() {
        return opUserNo;
    }

    /**
     * @param opUserNo
     */
    public void setOpUserNo(String opUserNo) {
        this.opUserNo = opUserNo == null ? null : opUserNo.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MessageSubscribe other = (MessageSubscribe) that;
        return (this.getChannelType() == null ? other.getChannelType() == null : this.getChannelType().equals(other.getChannelType()))
            && (this.getMessageType() == null ? other.getMessageType() == null : this.getMessageType().equals(other.getMessageType()))
            && (this.getSubscribeType() == null ? other.getSubscribeType() == null : this.getSubscribeType().equals(other.getSubscribeType()))
            && (this.getSubscribeValue() == null ? other.getSubscribeValue() == null : this.getSubscribeValue().equals(other.getSubscribeValue()))
            && (this.getOpUserNo() == null ? other.getOpUserNo() == null : this.getOpUserNo().equals(other.getOpUserNo()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getChannelType() == null) ? 0 : getChannelType().hashCode());
        result = prime * result + ((getMessageType() == null) ? 0 : getMessageType().hashCode());
        result = prime * result + ((getSubscribeType() == null) ? 0 : getSubscribeType().hashCode());
        result = prime * result + ((getSubscribeValue() == null) ? 0 : getSubscribeValue().hashCode());
        result = prime * result + ((getOpUserNo() == null) ? 0 : getOpUserNo().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", channelType=").append(channelType);
        sb.append(", messageType=").append(messageType);
        sb.append(", subscribeType=").append(subscribeType);
        sb.append(", subscribeValue=").append(subscribeValue);
        sb.append(", opUserNo=").append(opUserNo);
        sb.append("]");
        return sb.toString();
    }
}